@font-face {
    font-family: "iconfont";
    src: url("../fonts/bootstrap-icons.woff") format("woff");
}
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}
html, body {
    position: relative;;
    min-width: fit-content;
    max-width: 100%;
    margin: 0;
    overflow-x: hidden;
}
a {
    text-decoration: none;
    cursor: pointer;
    color: inherit;
}
p {
    margin: 0.5rem 0;
}
h1,h2,h3,h4,h5 {
    width: fit-content;
    margin: 0;
}
label {
    user-select: none;
    white-space: nowrap;
}
table {
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 0.5rem;
}
table caption {
    white-space: nowrap;
    font-weight: bolder;
    margin: 0.2rem;
}
caption.hide-content ~ * {
    display: none;
}
td, th {
    border: 1px solid grey;
    padding: 0.1rem;
}
th {
    white-space: nowrap;
}
th:first-child {
    border-radius: 0.5rem 0 0 0;
}
th:last-child {
    border-radius: 0 0.5rem 0 0;
}
tr:last-child td:first-child {
    border-radius: 0 0 0 0.5rem;
}
tr:last-child td:last-child {
    border-radius: 0 0 0.5rem 0;
}
details {
    text-align: start !important;
}

i.bi {
    font-style: normal;
    font-family: "iconfont";
    font-size: 1rem;
    line-height: 1.3rem;
}
badge {
    font-size: small;
    color: field;
    background-color: fieldtext;
    vertical-align: text-top;
    padding: 0 0.2rem;
    margin: 0 0.2rem;
    border-radius: 0.4rem;
    white-space: nowrap;
}
footer {
    position: absolute;
    bottom: 0.5rem;
}
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-track
{
    width: 6px;
    border-radius:10px;
    margin: 6px;
}
::-webkit-scrollbar-thumb {
    width: 6px;
    border-radius: 10px;
    border: 3px solid transparent;
    box-shadow: inset 0 0 6px gray;
}
::-webkit-scrollbar-thumb:hover {
    box-shadow: inset 0 0 10px gray;
}
::-webkit-scrollbar-corner,
::-webkit-scrollbar-button {
    display: none;
}

.black { color: black; }
.red { color: red; }
.green { color: green; }
.yellow { color: yellow; }
.blue { color: blue; }
.magenta { color: magenta; }
.cyan { color: cyan; }
.white { color: white; }
.bg-black { background-color: black; }
.bg-red { background-color: red; }
.bg-green { background-color: green; }
.bg-yellow { background-color: yellow; }
.bg-blue { background-color: blue; }
.bg-magenta { background-color: magenta; }
.bg-cyan { background-color: cyan; }
.bg-white { background-color: white; }

.hide {
    display: none !important;
}
.center{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
}
.vertical-center {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.container {
    position: relative;
    width: 100%;
    max-width: 2000px;
    text-align: center;
}
.rotate {
    display: inline-block;
    animation: 1s ease 0s infinite normal none running rotate;
}
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
}
.modal .modal-dialog {
    min-width: 200px;
    position: absolute;
    top: 50%;
    left: 50%;
    background: field;
    transform: translate(-50%, -50%);
    border: 2px solid;
    border-radius: 0.5rem;
    box-shadow: 0 0 40px gray;
    overflow-x: hidden;
    overflow-y: auto;
}
.modal-title h3 {
    margin: 0 auto;
    text-align: center;
}
.modal-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem;
}
.modal-footer {
    position: relative;
    display: flex;
    justify-content: center;
    bottom: 0;
    width: 100%;
    margin: 0.2rem auto;
}
.modal-footer * {
    margin: 0.5rem;
}

.code-editor {
    font-family: "Courier New", Courier, monospace;
    position: relative;
    margin-top: 0.5rem;
    border: 2px solid black;
    border-radius: 0.5rem;
    background: rgb(50, 50, 50);
    white-space: pre;
    word-wrap: anywhere;
    color: rgb(233, 233, 233);
    overflow: auto;
}
.text_input {
    display: flex;
    border: 2px solid;
    border-radius: 0.5rem;
    overflow: hidden;
    padding-left: 0.2rem;
}
.text_input>label:first-child {
    flex-grow: 0;
    flex-shrink: 0;
    height: 100%;
    border-right: 2px solid;
    padding: 0 0.5rem;
    font-size: 1rem;
    width: 5rem;
}
.text_input label {
    padding-left: 0.5rem;
}

.text_input>*:nth-child(2) {
    flex-grow: 1;
    flex-shrink: 1;
    border: none;
    font-size: 1rem;
    padding: 0 0.5rem;
    text-align: center;
    white-space: nowrap;
}
.text_input input:focus-visible {
    outline: none;
}
.must::before {
    position: absolute;
    content: "*";
}
.btn {
    display: inline-block;
    width: fit-content;
    height: fit-content;
    text-align: center;
    padding: 0.2rem 0.5rem;
    margin: 0.2rem;
    border: 2px solid;
    border-radius: 0.5rem;
    text-decoration: none;
    transform-origin: 50% 50%;
    transition: all 0.2s ease;
}
.btn:hover:not([disabled]) {
    cursor: pointer;
}
.btn:active:not([disabled]) {
    transform: scale(0.95);
}
.btn:focus {
    background: rgba(0, 0, 0, 0.15);
}
.btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}
.btn-shadow {
    box-shadow: 0 0 3px fieldtext;
}
.plain-btn {
    padding: 0;
    margin: 0;
    border: none;
    vertical-align: middle;
}

#header {
    position: relative;
    height: 2.5rem;
    border-bottom: 3px solid;
    padding-bottom: 0.2rem;
    text-align: center;
}
#header .btn {
    position: absolute;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 1.5rem;
    height: 1.5rem;
    padding: 0.2rem;
    top: 0;
    cursor: pointer;
}
#header .btn i{
    position: relative;
    display: block;
    user-select: none;
    font-size: 1.6rem;
    font-weight: bold;
}
#add_new_btn, #back_btn {
    left: 0;
}
#refresh_btn {
    left: 2.5rem;
}
#menu {
    position: absolute;
    width: 2rem;
    top: 0;
    left: 0;
}
.toggle-btn {
    position: absolute;
    display: none;
}
.toggle-btn ~ label {
    position: absolute;
    display: inline-block;
    cursor: pointer;
    user-select: none;
    left: 0;
  }
.toggle-btn ~ label span {
    display: block;
    width: 2rem;
    height: 0.25rem;
    background: fieldtext;
    margin: 0.4375rem;
    transition: transform 0.4s;
}
.toggle-btn ~ label span:nth-child(1) {
    transform: rotate(0deg);
}
.toggle-btn ~ label span:nth-child(2) {
    transform: scaleX(1);
}
.toggle-btn ~ label span:nth-child(3) {
    transform: rotate(0deg);
}
.toggle-btn:checked ~ label span:nth-child(1) {
    transform: rotate(-45deg) translate(-9px, 6px);
}
.toggle-btn:checked ~ label span:nth-child(2) {
    transform: scaleX(0);
}
.toggle-btn:checked ~ label span:nth-child(3) {
    transform: rotate(45deg) translate(-9px, -6px);
}
#title {
    margin: 0 auto;
}
#color_scheme {
    position: absolute;
    display: block;
    width: 3rem;
    height: 1.5rem;
    margin: 0.5rem;
    top: 0;
    right: 0;
    border-radius: 25%/50%;
    background-color: fieldtext;
    overflow: hidden;
    cursor: pointer;
}
#color_scheme.dark {
    background-color: fieldtext;
}
#color_scheme:before, #color_scheme:after {
    display: block;
    position: absolute;
    content: "";    
    width: 40%;
    height: 80%;
    border-radius: 50%;
    top: 10%;
    left: 5%;
    transition: transform .5s ease;
}
#color_scheme:before {
    background-color: field;
}
#color_scheme:after {
    background-color: fieldtext;
    left: -25%;
    transform: scale(0.00001);
}
#color_scheme.dark:before {
    background-color: field;
    transform: translateX(120%);
}
#color_scheme.dark:after {
    background-color: fieldtext;
    transform: translateX(150%) scale(1);
}
.main {
    position: relative;
    min-height: 90vh;
    margin-bottom: 2rem;
}
#empty_text {
    position: absolute;
    display: none;
    margin-top: 0.5rem;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}
#empty_text:only-child {
    display: initial;
}
#add_modal {
    display: none;
}
#add_modal .modal-dialog {
    background: field;
    max-height: 80%;
    width: 600px;
    max-width: 90%;
}
#add_modal .text_input {
    width: 90%;
    margin: 0.2rem;
}
.close-btn {
    position: absolute;
    right: 0.2rem;
    top: -0.7rem;
    user-select: none;
    transform-origin: 50% 50%;
    transition: all 0.2s ease;
}
.close-btn:hover:not(:disabled) {
    cursor: pointer;
}
.close-btn:active:not(:disabled) {
    transform: scale(0.95);
}
.close-btn:disabled {
    cursor: not-allowed;
}
.close-btn::after {
    content: "×";
    font-size: 2rem;
}

.capsule {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    width: fit-content;
    border: 2px solid;
    border-radius: 0.5rem;
    margin: 0.2rem;
}
.capsule>* {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.2rem;
    text-align: center;
    word-wrap: anywhere;
}
.capsule>span {
    border-left: 2px solid;
    border-right: 2px solid;
}
.capsule>span:last-child {
    border-right: none;
}
.capsule>div {
    border-bottom: 2px solid;
}
.capsule>div:last-child {
    border-bottom: none;
}
.pack[data-enable="0"] {
    opacity: 0.7;
}
.pack .disabled {
    display: none;
}
.pack[data-enable="0"] .disabled {
    display: initial;
}
.pack[data-enable="0"] .package-disable-btn {
    display: none;
}
.pack[data-enable="1"] .package-enable-btn {
    display: none;
}

.server-item {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
    height: 6rem;
    width: 80%;
    margin: 1rem;
    padding: 0.2rem;
    border: 3px solid;
    border-radius: 1rem;
    overflow: hidden;
    white-space: nowrap;
    box-shadow: 0 0 10px gray;
}
.server-icon {
    height: 6rem;
    width: 6rem;
    margin: 0.2rem;
    border-right: 1rem;
}
.server-info {
    flex-grow: 1;
    flex-shrink: 1;
    align-items: start;
    text-align: start;
    padding: 0 0.2rem;
    overflow: hidden;
}
.server-info span {
    font-weight: bold;
}
.server-info .capsule {
    margin: 0.1rem 0;
}
.server-link {
    display: inline-block;
    width: fit-content;
    max-width: 95%;
    overflow: hidden;
}
.server-toggle {
    position: absolute;
    top: 0.2rem;
    right: 0.4rem;
    cursor: pointer;
}
.server-desc {
    opacity: 0.6;
}
.server-pid {
    display: none;
}
.server-menu {
    position: absolute;
    display: flex;
    flex-direction: column;
    background: field;
    border: 2px solid;
    border-radius: 0.5rem;
    box-shadow: 0 0 30px gray;
}
.server-menu>* {
    white-space: nowrap;
    border-bottom: 2px solid;
    cursor: pointer;
    padding: 0 0.5rem;
}
.server-menu>*:last-child {
    border-bottom: none;
}

.terminal {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 85vh;
    width: 90%;
    margin: 1rem;
    padding: 0.5rem;
    font-size: small;
    background: field;
    border: 3px solid;
    border-radius: 0.5rem;
    scroll-behavior: smooth;
    transition: height 0.5s ease-in-out;
}
.terminal-small {
    height: 8rem;
}
.terminal-btn {
    position: absolute;
    width: 4rem;
    height: 14px;
    left: 50%;
    top: 100%;
    transform: translate(-50%, 0);
    background: field;
    line-height: 10px;
    border: 3px solid;
    border-radius: 0 0 8px 8px;
    border-top: none;
    cursor: pointer;
}
.terminal .terminal-screen {
    font-family: "Courier New", Courier, monospace;
    position: relative;
    flex-grow: 1;
    height: 800px;
    background: rgb(50, 50, 50);
    border-radius: 0.5rem;
    padding: 0.5rem;
    text-align: start;
    white-space: pre-wrap;
    word-wrap: anywhere;
    color: rgb(233, 233, 233);
    overflow-x: hidden;
    overflow-y: auto;
}
.terminal .terminal-input {
    position: relative;
    display: flex;
    flex-direction: row;
    background: rgb(50, 50, 50);
    height: 1rem;
    padding: 0.2rem;
    margin-top: 0.2rem;
    border-radius: 0.25rem;
    color: rgb(233, 233, 233);
}
.terminal .terminal-input::before {
    position: relative;
    content: "$";
    font-size: small;
}
.terminal .terminal-input input {
    flex-grow: 1;
    border: none;
    width: 100%;
    background: transparent;
    color: white;
}
.terminal .terminal-input input:focus-visible {
    outline: none;
}
.terminal-cover {
    position: absolute;
    display: none;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    color: field;
    font-size: large;
    border-radius: 0.3rem;
    justify-content: center;
}
.terminal-cover::after {
    content: " ";
    position: absolute;
    width: 4rem;
    height: 14px;
    left: 50%;
    top: 100%;
    transform: translate(-50%, 0);
    background: rgba(0, 0, 0, 0.3);
}

.server-panel {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    height: fit-content;
    width: 90%;
    margin: 1rem;
    padding: 0.5rem;
    border: 3px solid;
    border-radius: 0.5rem;
}
.server-panel>* {
    position: relative;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-evenly;
    align-items: center;

    flex-grow: 1;
    flex-shrink: 1;
    flex-basis: 50%;
}
.server-detail #server_motd {
    max-height: 3rem;
    cursor: pointer;
    white-space: pre-wrap;
    overflow: hidden;
    overflow-y: auto;
}
.server-detail>*:nth-child(-n+4) {
    flex-grow: 1;
    flex-basis: 100%;
}
.server-detail>*:nth-child(n+5) {
    flex-grow: 1;
    flex-basis: 25%;
}
.server-detail>*>span:nth-child(3) {
    overflow-x: hidden;
    min-width: 4rem;
    flex-grow: 1;
}
.server-detail>*>span:nth-child(n+4) {
    white-space: nowrap;
}
.server-detail>*>*:nth-child(2) {
    width: 4rem;
}
.server-detail>*>*:nth-child(3n-1) {
    border: none;
    min-width: 2rem;
}
.server-control {
    display: flex;
    justify-content: space-between;
    align-content: space-between;
}
.server-control .btn {
    flex-grow: 1;
    flex-shrink: 1;
    flex-basis: 20%;
    margin: 0.4rem 5%;
}
.server-perf {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    flex-grow: 1;
    flex-shrink: 1;
    flex-basis: 100%;
}
.server-perf>* {
    flex-grow: 1;
}
.server-perf>*>*:nth-child(2) {
    border: none;
    min-width: 2rem;
}
.server-perf>*>*:nth-child(3) {
    flex-grow: 1;
}
#header #server_icon {
    display: none;
    vertical-align: bottom;
    height: 2.4rem;
    width: 2.4rem;
}
.server-detail #server_icon {
    display: inline-block;
    vertical-align: bottom;
    height: 1rem;
    width: 1rem;
}
#server_name_div {
    display: none;
}
#player_list, #room_list, #pack_list {
    flex-basis: 100%;
    min-height: 2rem;
    margin: 0.2rem;
    padding: 0.2rem;
    padding-top: 1.2rem;
    border: 2px solid;
    border-radius: 0.5rem;
    overflow: hidden;
}
#pack_list>* {
    flex-basis: 100%;
}
#pack_list>*>* {
    text-align: start;
}
#pack_list summary {
    text-align: start;
}
#pack_list summary span {
    vertical-align: top;
}
.list-title {
    position: absolute;
    top: 0;
    font-weight: bold;
    user-select: none;
}

#git_tree {
    display: flex;
    border: 2px solid;
    border-radius: 0.5rem;
    margin: 0.5rem;
    padding: 0.5rem;
    flex-direction: column;
    align-items: center;
}
#git_nav {
    display: inline-flex;
    border: 2px solid;
    border-radius: 0.5rem 0.5rem 0 0;
    border-bottom: none;
    margin: 0 1rem;
    padding: 0;
}
#git_nav li {
    display: inline;
    font-weight: bolder;
    cursor: pointer;
    border-right: 2px solid;
    padding: 0 0.2rem;
    opacity: 0.4;
}
#git_nav li.active {
    opacity: 1;
}
#git_nav li:last-child {
    border-right: none;
}
#git_content {
    border: 2px solid;
    border-radius: 0.5rem;
    padding: 0.2rem;
    min-width: 15rem;
}
.commit_page {
    display: none;
}
.commit_page.active {
    display: inherit;
    width: 100%;
    text-align: center;
}
.commit_page>* {
    width: auto;
}
.commit_page .btn {
    min-width: 2rem;
}
.commit-details>div:nth-child(1) {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    border-right: 2px solid;
    border-bottom: none;
}
.commit-details>div:nth-child(1)>div {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 0 0.2rem;
}
.commit-details>div:nth-child(1) span {
    flex-grow: 1;
    height: 100%;
    margin: 0 0.2rem;
    border-left: 2px solid;
    border-right: 2px solid;
}
.commit-details>div:nth-child(1) span:last-child {
    border-right: none;
}
.commit-details>div:nth-child(1)>div:nth-child(1) {
    border-bottom: 2px solid;
}
.commit-details>div:nth-child(1)>div:nth-child(2) span {
    white-space: nowrap;
}

@media (max-width: 800px) {
    .server-item {
        width: 560px;
    }
}
@media (max-width: 500px) {
    .commit-date {
        display: none;
    }
}
@media (max-width: 600px) {
    .server-time,
    .server-port {
        display: none !important;
    }
    .server-version {
        border-right: none !important;
    }
    .server-item {
        width: 400px;
    }
    .server-panel {
        flex-direction: column;
    }
}
@media (max-width: 440px) {
    .server-item {
        width: 360px;
    }
}
@media (max-width: 400px) {
    #title {
        display: none;
    }
    #server_name_div {
        display: flex;
    }
    .server-version {
        display: none !important;
    }
    .server-players {
        border-right: none !important;
    }
    .text_input>*:nth-child(2) {
        text-align: start !important;
    }
    .server-item {
        width: 280px;
    }
    .terminal {
        padding: 2%;
    }
}
@media (max-width: 380px) {
    .commit-author {
        display: none;
    }
}
@media (min-width: 1000px) {
    .server-item {    
        min-width: 800px;
    }
}
